﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NS.Utilities;
using NS.BLL.Systems;
using Model;
using BLL;

public partial class Platform_MemberModify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataShow();
        }
    }
    private void DataShow()
    {
        Member Model = MemberService.GetMemberByMemberID(int.Parse(Request.QueryString["MemberID"].ToString()));
        if (Model != null)
        {
            txtCardNumber.Text = Model.CardNumber;
        }
    }

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Member Model = MemberService.GetMemberByMemberID(int.Parse(Request.QueryString["MemberID"].ToString()));
        Model.CardNumber = txtCardNumber.Text;
        if (MemberService.UpdateMemberByMemberID(Model) > 0)
        {
            MessageBox.AppendScript(this, "$(':input[id$=\"btnSearch\"]', window.parent.document.body).click();");
        }
        else
        {
            MessageBox.ShowSaveError(this);
        }
    }

}